﻿using System;
using System.Web.UI;
using Succell.Dnn.JQuery.UI;

namespace Succell.Dnn.JQuery.Extras
{
    /// <summary>
    /// Creates a <see cref="WindowedDialogChild"/> control.
    /// </summary>
    public class WindowedDialogChild : Control
    {
        #region page lifecycle

        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            if (null != this.Page && this.Visible)
            {
                this.Page.RegisterJQueryUI();
                this.Page.ClientScript.RegisterClientScriptInclude(typeof(WindowedDialogChild), "WindowedDialogChild", this.ResolveUrl("~/DesktopModules/Succell.JQuery.Extras/js/jquery-ui.windowedDialogChild.0.5.1.min.js"));
            }
        }

        protected override void Render(HtmlTextWriter writer)
        {
        }

        #endregion
    }
}
